<!DOCTYPE html>
<html>

<head>
    <meta name="layout" content="main2"/>
    <g:set var="entityName" value="${message(code: 'user.label', default: 'user')}"/>

    <title>新增用户</title>
</head>

<body>

<div class="main-body">
    <div class="page-wrapper">
        <!-- Page-header start -->
        <div class="page-header">
            <div class="page-header-title">
                <h4>新增用户</h4>
            </div>

            <div class="page-header-breadcrumb">
                <ul class="breadcrumb-title">
                    <li class="breadcrumb-item">
                        <a href="/salesDashboard/index">
                            <i class="icofont icofont-home"></i>
                        </a>
                    </li>
                    <li class="breadcrumb-item">
                        <g:link controller="user" action="index">用户列表</g:link>
                    </li>
                    <li class="breadcrumb-item"><a href="#!">新增用户</a>
                    </li>
                </ul>
            </div>
        </div>
        <!-- Page-header end -->
        <!-- Page-body start -->
        <div class="page-body">
            <g:if test="${flash.message}">
                <div class="message alert alert-info" role="status">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${this.user}">
                <ul class="errors" role="alert">
                    <g:eachError bean="${this.user}" var="error">
                        <li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>>
                            <g:message error="${error}"/>
                        </li>
                    </g:eachError>
                </ul>
            </g:hasErrors>

        <!-- Hover table card start -->
            <div class="card">
                <div class="card-header">
                    <h5>新增用户</h5>

                    <div class="card-header-right">

                        <i class="icofont icofont-rounded-down"></i>
                    </div>
                </div>

                <div class="card-block">
                    <g:form action="save">

                        <div class="form-group row">
                            <label class="col-md-2 control-label is-required">用户名</label>

                            <div class="col-md-3">
                                <g:textField class="form-control" type="text" value="${this.user?.username}"
                                             name="username" id="username"/>
                            </div>
                            <label class="col-md-2 control-label is-required">密码</label>

                            <div class="col-md-3">
                                <g:field class="form-control" type="password" name="password" id="password"/>
                            </div>
                        </div>

                        

                        <div class="form-group row">
                            <label class="col-md-2 control-label">部门</label>

                            <div class="col-md-3">
                                <g:select class="form-control" name="department" value="${this.user?.department}"
                                          optionKey="id" optionValue="name"
                                          from="${com.next.Department.findAllByActive(true)}"
                                          noSelection="['': '-请选择-']"/>
                            </div>
                            <label class="col-md-2 control-label">岗位</label>

                            <div class="col-md-3">
                                <g:select class="form-control" name="position" value="${this.user?.position}"
                                          optionKey="id" optionValue="name"
                                          from="${com.next.Position.findAllByActive(true)}"
                                          noSelection="['': '-请选择-']"/>
                            </div>

                        </div>


                        <div class="form-group row">
                            <label class="col-md-2 control-label is-required">姓名</label>

                            <div class="col-md-3">
                                <g:textField class="form-control" type="text" name="fullName"
                                             value="${this.user?.fullName}" id="fullName"/>
                            </div>
                            <label class="col-md-2 control-label is-required">手机</label>

                            <div class="col-md-3">
                                <g:textField class="form-control" type="text" name="cellphone"
                                             value="${this.user?.cellphone}" id="cellphone" MaxLength="11"/>
                            </div>
                        </div>


                        <div class="form-group row">
                            <label class="col-md-2 control-label">汇报对象</label>

                            <div class="col-md-3">
                                <g:select class="form-control" name="reportTo" value="${this.user?.reportTo}"
                                          optionKey="id" optionValue="fullName" from="${com.next.User.list()}"
                                          noSelection="['': '-请选择-']"/>
                            </div>
                        </div>

                        <div class="form-group row">
                            <label class="col-md-3 control-label">共享日历给上级</label>
                            <div class="col-md-2 border-checkbox-section">
                                <div class="border-checkbox-group border-checkbox-group-primary form-control-static">
                                    <g:checkBox class="border-checkbox"
                                                value="${this.user?.shareActivityToSupervisor}"
                                                name="shareActivityToSupervisor" id="checkbox0"/>
                                    <label class="border-checkbox-label" for="checkbox0"></label>
                                </div>

                            </div>

                            <label class="col-md-3 control-label">共享客户给上级</label>
                            <div class="col-md-2 border-checkbox-section">
                                <div class="border-checkbox-group border-checkbox-group-primary form-control-static">
                                    <g:checkBox class="border-checkbox"
                                                value="${this.user?.shareAccountToSupervisor}"
                                                name="shareAccountToSupervisor" id="checkbox1"/>
                                    <label class="border-checkbox-label" for="checkbox1"></label>
                                </div>

                            </div>

                        </div>

                        <div class="hr-line-dashed"></div>

                        <div class="form-group row">
                            <label class="col-md-3 control-label">共享联系人给上级</label>


                            <div class="col-md-2 border-checkbox-section">
                                <div class="border-checkbox-group border-checkbox-group-primary form-control-static">
                                    <g:checkBox class="border-checkbox"
                                                value="${this.user?.shareContactToSupervisor}"
                                                name="shareContactToSupervisor" id="checkbox2"/>
                                    <label class="border-checkbox-label" for="checkbox2"></label>
                                </div>

                            </div>

                            <label class="col-md-3 control-label">共享线索给上级</label>
                            <div class="col-md-2 border-checkbox-section">
                                <div class="border-checkbox-group border-checkbox-group-primary form-control-static">
                                    <g:checkBox class="border-checkbox"
                                                value="${this.user?.shareLeadToSupervisor}"
                                                name="shareLeadToSupervisor" id="checkbox3"/>
                                    <label class="border-checkbox-label" for="checkbox3"></label>
                                </div>

                            </div>

                        </div>

                        <div class="hr-line-dashed"></div>

                        <div class="form-group row">
                            <label class="col-md-3 control-label">共享商机给上级</label>
                            <div class="col-md-2 border-checkbox-section">
                                <div class="border-checkbox-group border-checkbox-group-primary form-control-static">
                                    <g:checkBox class="border-checkbox"
                                                value="${this.user?.shareOpptToSupervisor}"
                                                name="shareOpptToSupervisor" id="checkbox4"/>
                                    <label class="border-checkbox-label" for="checkbox4"></label>
                                </div>

                            </div>


                            <label class="col-md-3 control-label">共享市场活动给上级</label>
                            <div class="col-md-2 border-checkbox-section">
                                <div class="border-checkbox-group border-checkbox-group-primary form-control-static">
                                    <g:checkBox class="border-checkbox"
                                                value="${this.user?.shareCampaignToSupervisor}"
                                                name="shareCampaignToSupervisor" id="checkbox5"/>
                                    <label class="border-checkbox-label" for="checkbox5"></label>
                                </div>

                            </div>

                        </div>


                        <div class="form-group row">
                            <label class="col-md-3 control-label">共享反馈给上级</label>
                            <div class="col-md-2 border-checkbox-section">
                                <div class="border-checkbox-group border-checkbox-group-primary form-control-static">
                                    <g:checkBox class="border-checkbox"
                                                value="${this.user?.shareIssueToSupervisor}"
                                                name="shareIssueToSupervisor" id="checkbox6"/>
                                    <label class="border-checkbox-label" for="checkbox6"></label>
                                </div>

                            </div>

                            <label class="col-md-3 control-label">共享资产给上级</label>
                            <div class="col-md-2 border-checkbox-section">
                                <div class="border-checkbox-group border-checkbox-group-primary form-control-static">
                                    <g:checkBox class="border-checkbox"
                                                value="${this.user?.shareAssetToSupervisor}"
                                                name="shareAssetToSupervisor" id="checkbox7"/>
                                    <label class="border-checkbox-label" for="checkbox7"></label>
                                </div>

                            </div>

                        </div>


                        <div class="form-group row">
                            <div class="col-md-12">
                                <g:submitButton class="btn btn-info" name="create" value="保存"/>
                            </div>
                        </div>
                    </g:form>

                </div>
                <!-- Hover table card end -->
            </div>

            <!-- Page-body end -->
        </div>
    </div>
</div>

</body>

</html>
